﻿using System.ComponentModel;

namespace Labthink.PCSoft.UniversalHost4.Model
{
    /// <summary>
    /// 参数方案
    /// </summary>
    public partial class ParamScheme: INotifyPropertyChanged
    {
        private string _schemeName;

        public int Id { get; set; }

        /// <summary>
        /// 试验类型
        /// </summary>
        public int TestType { get; set; }

        /// <summary>
        /// 试验类型名称
        /// </summary>
        public string TestTypeName { get; set; }

        /// <summary>
        /// 方案名称
        /// </summary>
        public string SchemeName
        {
            get => _schemeName;
            set
            {
                _schemeName = value;
                OnPropertyChanged(nameof(SchemeName));
            }
        }

        /// <summary>
        /// 方案内容
        /// </summary>
        public string Scheme { get; set; }

        /// <summary>
        /// 是否是默认方案
        /// </summary>
        public bool IsDefault { get; set; }

        /// <summary>
        /// 初始没有参数方案时，系统自动添加试验类型同名的参数方案，不可删除
        /// </summary>
        public bool IsSystemAdded = false;

        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            handler?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
